package fight.view
{
	import fight.FightC;
	import fight.model.InfoVO;
	import org.airmvc.Dispatcher;
	
	import interfaces.IOperate;
	
	import ui.fight.InfoPanelUI;
	
	
	public class InfoPanel extends InfoPanelUI implements IOperate
	{
		public function InfoPanel()
		{
			this.x = 130;
			this.y = 310;
		}
		
		public function update(isAttack:Boolean,ifvo:InfoVO):void
		{
			if (isAttack)
			{
				btStrength1.text = String(ifvo.strength);
				btSowar1.text = String(ifvo.sowarNum);
				btBowman1.text = String(ifvo.bowmanNum);
				btInfantry1.text = String(ifvo.infantryNum);
			}
			else
			{
				btStrength2.text = String(ifvo.strength);
				btSowar2.text = String(ifvo.sowarNum);
				btBowman2.text = String(ifvo.bowmanNum);
				btInfantry2.text = String(ifvo.infantryNum);
			}
			
		}
		
		public function execute(keyCode:int):void
		{
			if(keyCode == 32)
			{
				Dispatcher.send(FightC.OPEN_CONTROL_PANEL, this);
			}
		}
	}
}